import { createApp } from "vue";
import App from "./App.vue";
import ElementPlus from "element-plus";
import "element-plus/dist/index.css";
import router from "@/router/index.js";
import { createPinia } from "pinia";
import { createPersistedState } from "pinia-persistedstate-plugin";
import VueVideoPlayer from "@videojs-player/vue";
import "video.js/dist/video-js.css";
import zhCn from "element-plus/es/locale/lang/zh-cn"; // 导入中文语言包
import { ElMessage } from "element-plus";

const app = createApp(App);
const pinia = createPinia();
pinia.use(createPersistedState());
app.use(pinia);
app.use(ElementPlus, { locale: zhCn }); // 设置 ElementPlus 使用中文语言包
app.use(router);

app.use(VueVideoPlayer);

// // 检查标志
// if (localStorage.getItem("hasShownLoginMessage") === "true") {
//   // 清除标志
//   localStorage.removeItem("hasShownLoginMessage");

//   // 显示消息
//   ElMessage.error("身份过期，请重新登录");

//   // 跳转到登录页面
//   router.push("/login");

//   // 清除token
//   localStorage.removeItem("token");
//   sessionStorage.removeItem("token");
// }

app.mount("#app");
